//
//  DistributionTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/27.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "DistributionTableViewCell.h"

@implementation DistributionTableViewCell{
    GLGWLabel *titleLabel;
    GLGWLabel *miaoShuLabel;
    GLGWButton *selectButt;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setSepartionLineWith:lineModel_Half];
        titleLabel = [[GLGWLabel alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(15), kHeightProportion_In_iPhoneTriploid(12), KScreenWidth - kWidthProportion_In_iPhoneTriploid(65), kHeightProportion_In_iPhoneTriploid(20)) theFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#666666"] inSuperView:self];
        titleLabel.text = @"卖家承运";
        //
        miaoShuLabel = [[GLGWLabel alloc] initWithFrame:CGRectMake(titleLabel.x, kY_With_View(titleLabel, 5), titleLabel.width, kHeightProportion_In_iPhoneTriploid(17)) theFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self];
        miaoShuLabel.text = @"由卖方发货，并提供售后服务";
        //
        GLGWButton * selectBut = [[GLGWButton alloc] initInSuperView:self.contentView];
//        selectBut.backgroundColor = kRandomColor;
        [selectBut mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(9));
            make.right.equalTo(self.contentView.mas_right).offset(0);
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(50)));
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(50)));
        }];
        [selectBut setImage:[UIImage imageNamed:@"icon_xuanzhe_zhaopian"] forState:UIControlStateNormal];
        selectButt = selectBut;
        selectBut.userInteractionEnabled = NO;
    }
    return self;
}

- (void)setModel:(FillExpressModel *)model
{
    _model = model;
    titleLabel.text = model.topStr;
    miaoShuLabel.text = model.detailStr;
    if (model.isShow) {
        [selectButt setImage:[UIImage imageNamed:@"icon_xuanzhe_zhaopian"] forState:UIControlStateNormal];
    } else {
        [selectButt setImage:[UIImage imageNamed:@"icon_weixuanzhe"] forState:UIControlStateNormal];
    }
}
@end
